import request from '@/utils/request'

// 查询优惠团购列表
export function listGroupBuying(query) {
  return request({
    url: '/merchant/groupBuying/list',
    method: 'get',
    params: query
  })
}

// 查询优惠团购详细
export function getGroupBuying(id) {
  return request({
    url: '/merchant/groupBuying/' + id,
    method: 'get'
  })
}

// 新增优惠团购
export function addGroupBuying(data) {
  return request({
    url: '/merchant/groupBuying',
    method: 'post',
    data: data
  })
}

// 修改优惠团购
export function updateGroupBuying(data) {
  return request({
    url: '/merchant/groupBuying',
    method: 'put',
    data: data
  })
}

// 删除优惠团购
export function delGroupBuying(id) {
  return request({
    url: '/merchant/groupBuying/' + id,
    method: 'delete'
  })
}
